<?php
/**
 * Yii view _email
 *
 * @author nguyenmanhluu
 * @since Jul 27, 2013 - 9:34:49 PM
 */
?>
<div class="row-fluid row-email">	
    <div class="box span12 box-email">
        <div class="box-header">
            <h2>
                <i class="icon-bell"></i>
                <?php echo $model->letter_name ?>
            </h2>
            <div class="box-icon">
                <a class="btn-minimize" href="#"><i class="icon-chevron-down"></i></a>
            </div>
        </div>
        <div class="box-content">
            <p>
                Allow: 
                <?php echo implode(", ", MyEmail::getAllCode()); ?>
            </p>
            <br/>
            <?php
            $form_id = 'form-email-' . $model->letter_id;
            $form    = $this->beginWidget('CActiveForm', array(
                'id'                     => $form_id,
                'enableAjaxValidation'   => true,
                'enableClientValidation' => true,
                'htmlOptions'            => array(
                    'class'   => 'form-horizontal',
                    'enctype' => 'multipart/form-data',
                ),
                'clientOptions'          => array(
                    'validateOnSubmit' => true,
                ),
                'action'                 => Yii::app()->createUrl('setting/editEmail', array(
                    'pk' => $model->letter_id
                )),
            ));
            ?>
            <?php echo CHtml::errorSummary($model); ?>
            <fieldset>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'letter_title', array('class' => 'control-label')); ?>
                    <div class ="controls">
                        <?php
                        echo $form->textField($model, 'letter_title', array(
                            'placeholder' => $model->getAttributeLabel('letter_title'),
                            'class'       => 'input-file uniform_on input-reset'
                        ));
                        ?>
                        <font color="red"><?php echo $form->error($model, 'letter_title'); ?></font>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'letter_content', array('class' => 'control-label')); ?>
                    <div class ="controls">
                        <?php
                        echo $form->textArea($model, 'letter_content', array(
                            'class'       => 'cleditor',
                            'placeholder' => $model->getAttributeLabel('letter_content'),))
                        ?>
                        <font color="red"><?php echo $form->error($model, 'letter_content'); ?></font>
                    </div>
                </div>                
                <hr />
                <button type="submit" class="btn btn-primary">Save changes</button>
            </fieldset>
            <?php $this->endWidget(); ?>
        </div>

    </div><!--/span-->
</div>